<template>
  <div id="myChart2" style="width: 400px; height: 300px"></div>
</template>

<script>
import * as echarts from "echarts";
export default {
  data() {
    return {
      chart: null, // 用于保存图表的实例
      option: {
        title: {
          text: "",
          subtext: "",
          left: "",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "",
          left: "left",
          textStyle: {
            color: "#ffffff",
          },
        },
        series: [
          {
            name: "",
            type: "pie",
            radius: "50%",
            data: [
              { value: 580, name: "1000万" },
              { value: 484, name: "2000万" },
              { value: 300, name: "3000万" },
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            label: {
              color: "#ffffff",
            },
          },
        ],
      },
    };
  },
  mounted() {
    this.chart = echarts.init(document.getElementById("myChart2"));
    this.chart.setOption(this.option);
  },
  // ... 其他选项，如methods, computed等
};
</script>

<style lang="scss">
/* 样式代码 */
</style>
